home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Extra 1997 #4
/
Amiga Plus Extra 1997 #4.iso
/
pd
/
grafik
/
video easel
/
camrexx
/
randanneal.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-06-09
|
662b
|
26 lines
/* Rand-Anneal by an idea of Toffoli, CAMRexx version by THOR */
MakeAlgorithm:
PLANEALGORITHM neumann hv
return
MakePlane:
if plane=0 then; do
/* anneal-algorithm */
sum=center+north+south+west+east
rand=center_ & north_ & south_ & west_ & east_
if sum<parameters.border-1 then SETPLANE off
if sum=parameters.border-1 then SETPLANE rand
if sum=parameters.border then; do
rand=~rand
SETPLANE rand
end
if sum>parameters.border then SETPLANE on
end
/* "random" generator */
if plane=1 then; do
rand=(east_ & south_ ) ^ west_ ^ north_ ^ center_
SETPLANE rand
end
return